how to build a rest api with mysql